<template>
  <div class="“show-examples”">
    <el-row class="chaxun">
      <el-col :span="7"
        ><el-input
          placeholder="请输入手机号码查询"
          v-model="keyword"
          suffix="el-icon-search"
          clearable
        >
          <el-button
            slot="append"
            icon="el-icon-search"
            @click="getblogData"
            v-bind:disabled="keyword.length!=11"
          ></el-button> </el-input
      ></el-col>
      <el-col :span="4"></el-col>
    </el-row>
    <el-table :data="blogData" border style="width: 100%">
      <el-table-column prop="name" label="会员姓名" width="180" align="center">
      </el-table-column>
      <el-table-column prop="password" label="密码" width="180" align="center">
      </el-table-column>
      <el-table-column prop="sex" label="性别" align="center">
      </el-table-column>
      <el-table-column prop="tel" label="电话号码" align="center">
      </el-table-column>
      <el-table-column prop="id_card" label="身份证" align="center">
      </el-table-column>
      <el-table-column prop="create_time" label="创建时间" align="center">
      </el-table-column>
      <el-table-column prop="update_time" label="更新时间" align="center">
      </el-table-column>
      <el-table-column prop="money" label="卡中余额" align="center">
      </el-table-column>
    </el-table>
  </div>
</template>
<script>

import axios from "axios";

export default {
  name: "show-examples",
  data() {
    return {
      blogData: [],
      keyword: ""
    };
  },
  methods: {
    
    getblogData() {
      let obj ={tel:this.keyword}
      this.$axios({
        url:'/website/userController/getTelData',
        method:'post',
        data:obj
      }).then(res=>{
        this.blogData=[];
        console.log(res.data.Data)
         this.blogData.push(res.data.Data)
         if(res.data.Data==undefined){
          this.$message.error('手机号不存在，查询失败！')
        }else{
           this.$message.success('查询成功')
        }
      })
       this.keyword=''
    }
  }
};
</script>
<style scoped>
.chaxun {
  padding: 20px 0;
}
</style>